﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Graphene.Storing
{
    public class PointReal3D : Graphene.Storing.PointReal2D
    {
        public PointReal3D() : base()
        {
            this.z = 0.0f;
        }
        
        public PointReal3D(float x, float y, float z) : base(x, y)
        {            
            this.z = z;
        }

        public Microsoft.DirectX.Vector3 ToVector3()
        {
            return new Microsoft.DirectX.Vector3(x, y, z);
        }

        public override bool Equals(Object obj)
        {
            if (obj == null)
            {
                return false;
            }

            PointReal3D p = obj as PointReal3D;
            if ((System.Object)p == null)
            {
                return false;
            }

            return (this.x == p.X) && (y == p.Y)  && (y == p.Z);
        }

        public bool Equals(PointReal3D p)
        {
            if ((object)p == null)
            {
                return false;
            }

            return (base.x == p.X) && (base.y == p.Y) && (this.z == p.Z);
        }

        public override int GetHashCode()
        {
            return (int)base.x ^ (int)base.y ^ (int)this.z;
        }

        public float Z
        {
            get { return z; }
        }

        private float z;     
    }
}
